package cn.com.callback

import cn.com.callback.CallBackInvoke
import cn.com.elite.EliteBean
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory

/**
 *
 * @Title: auto_SmsInfoTaskplresult 将待捞取结果的短信的批次放入线程表
 * @author: chieh
 * @date 2022-02-10 10:28:00
 *
 */
public class auto_SmsInfoTaskplresult implements CallBackInvoke {
    private static final Log log = LogFactory.getLog(auto_SmsInfoTaskplresult.class);

    public void doCallBack(EliteBean eliteBean, String callBack, Map map, String paramString) {
        String dealSQL = '''Insert Into Elitethread
                              (Thread_Guid, Createdate, Status, Content, Type)
                              Select Newid(), Getdate(), 0, Sms_Guid, Type_Id + 'result\'
                                From (Select Sms_Guid, Type_Id
                                        From Ucis_Sms_Send a With(Nolock)
                                       Group By Sms_Guid, Type_Id) R1
                                Left Join Elitethread R2 With(Nolock)
                                  On R1.Type_Id + 'result' = R2.Type
                                 And R1.Sms_Guid = R2.Content
                                 And R2.Status != '2\'
                               Where R2.Thread_Guid Is Null''';
        int dealResult = eliteBean.update(dealSQL, "dataSource");
        log.debug("将待捞取结果的短信的批次放入线程表结果：" + dealResult);
		
		
    }

}